import React from 'react'
import styles from '../css/Item.module.css'
import { useNavigate } from 'react-router-dom'
function Item(props) {
    // console.log(props);
    let nav = useNavigate()
    return (
        <div className={styles.body}
            onClick={() => {
                nav(`/ticket/:id?id=${props.id}&start=${props.startStation}&end=${props.endStation}`)
            }}
        >
            <div className={styles.box}>
                <span className={styles.font}>{props.startTime}</span>
                <span>{props.timeTaken}</span>
                <span className={styles.font}>{props.endTime}</span>
                <span>{props.startStation}</span>
                <span>{props.trainNo}</span>
                <span>{props.endStation}</span>
                <span>二等<span className={styles.bb}>{props.businessSeat.ticketNum}</span></span>
                <span>一等<span className={styles.bb}>{props.fsoftSeat.ticketNum}</span></span>
                <span>商务<span className={styles.bb}>{props.ssoftSeat.ticketNum}</span></span>
            </div>
            <div className={styles.two}>
                ￥{props.ssoftSeat.price}
            </div>
        </div>
    )
}

export default Item
